CREATE TABLE [dbo].[DashboardGroupLinks](
	[DashboardGroupLinkId] [int] IDENTITY(1,1) NOT NULL,
	[UserGroupId] [int] NOT NULL,
	[DashboardId] [int] NOT NULL,
 CONSTRAINT [PK_DashboardGroupLinks] PRIMARY KEY CLUSTERED 
(
	[DashboardGroupLinkId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[DashboardGroupLinks]  WITH NOCHECK ADD  CONSTRAINT [FK_DashboardGroupLinks_Dashboards] FOREIGN KEY([DashboardId])
REFERENCES [dbo].[Dashboards] ([DashboardId])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[DashboardGroupLinks] CHECK CONSTRAINT [FK_DashboardGroupLinks_Dashboards]
GO

ALTER TABLE [dbo].[DashboardGroupLinks]  WITH NOCHECK ADD  CONSTRAINT [FK_DashboardGroupLinks_Usergroups] FOREIGN KEY([UserGroupId])
REFERENCES [dbo].[UserGroups] ([UserGroupId])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[DashboardGroupLinks] CHECK CONSTRAINT [FK_DashboardGroupLinks_Usergroups]
GO

